Skip to content

C++ Misc Cleanup: More override, std-header, std::make_* usage, ..#10012

Merged
caolanm merged 1 commit intomasterfrom
private/sgothel/cleanup_02
Sep 9, 2024
Merged

C++ Misc Cleanup: More override, std-header, std::make_* usage, ..#10012
caolanm merged 1 commit intomasterfrom
private/sgothel/cleanup_02

Conversation

@sgothel
Copy link

@sgothel sgothel commented Sep 9, 2024

Summary

  • Use override for virtual function overrides (incl. dtor)
  • Use C++ std headers, e.g. cctype instead of ctype.h
  • Use global anonym namespace for system functions or std:: system functions, whichever is applicable
  • Use std::make_shared(..)
  • Use std::make_unique()
  • Use 'const' where applicable
  • Use pre-incr where applicable
  • Use typename where applicable
  • Drop redundant type conversions

Change-Id: Id844187c82fce3c6e9bceb512c07180705608ebc

Checklist

  • I have run make prettier-write and formatted the code.
  • All commits have Change-Id
  • I have run tests with make check
  • I have issued make run and manually verified that everything looks okay
  • Documentation (manuals or wiki) has been updated or is not required

- Use override for virtual function overrides (incl. dtor)
- Use C++ std headers, e.g. cctype instead of ctype.h
- Use global anonym namespace for system functions
  or std:: system functions, whichever is applicable
- Use std::make_shared<StreamSocket>(..)
- Use std::make_unique<Watchdog>()
- Use 'const' where applicable
- Use pre-incr where applicable
- Use typename where applicable
- Drop redundant type conversions

Signed-off-by: Sven Göthel <[email protected]>
Change-Id: Id844187c82fce3c6e9bceb512c07180705608ebc
@sgothel sgothel force-pushed the private/sgothel/cleanup_02 branch from 6d9ea3f to 718ad77 Compare September 9, 2024 07:52
if (clientInfo.sin6_family == AF_INET)
{
auto ipv4 = (struct sockaddr_in *)&clientInfo;
struct sockaddr_in *ipv4 = (struct sockaddr_in *)&clientInfo;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could probably replace the c-style "struct sockaddrWhatever" with c++-style "sockaddrWhatever", but that's just an observation.

@caolanm caolanm merged commit 9d73307 into master Sep 9, 2024
@caolanm caolanm deleted the private/sgothel/cleanup_02 branch September 9, 2024 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants